/*
 * @Author: cmd 
 * @wechat: cmd_develop 
 * @Date: 2021-03-05 09:12:24 
 * @Last Modified by: cmd 
 * @Last Modified time: 2021-03-05 09:12:24 
 * @Description: main.ts
 */

import { Application } from "https://deno.land/x/oak/mod.ts";
//import { Router } from "https://deno.land/x/oak/mod.ts";
import router from './router.ts';
const app = new Application();

// const router = new Router();
// const realPath = Deno.realPathSync('controllers');
// for (const dirEntry of Deno.readDirSync('controllers')) 
// {    
//     const controller = await import(`file://${realPath}/${dirEntry.name}`);
//     for(const key in controller.default)
//     {     
//         //console.log('>>>>>>>>>>>>>>>>',`/${controller.name}/${key}`);  
//         router.get(`/${controller.name}/${key}`, controller.default[key]);
//     }
   
// }
app.use(router.routes());
app.use(router.allowedMethods());
await app.listen({ port: 8080 });
